package main

import (
	"fmt"
	"sort"
)

func main() {
	//1、sort升序排序
	//intList := []int{2, 3, 5, 67, 8, 90, 3, 1, 22, 0}
	//floatList := []float64{3.2, 3.3, 6.6, 8.8, 9.3, 1.1, 0.0, 31.3}
	//stringList := []string{"a", "b", "e", "q", "d", "g", "j", "p", "m", "c"}
	//sort.Ints(intList)
	//sort.Float64s(floatList)
	//sort.Strings(stringList)
	//fmt.Println(intList)
	//fmt.Println(floatList)
	//fmt.Println(stringList)

	//2、sort降序排序
	intList := []int{2, 3, 5, 67, 8, 90, 3, 1, 22, 0}
	//floatList := []float64{3.2, 3.3, 6.6, 8.8, 9.3, 1.1, 0.0, 31.3}
	//stringList := []string{"a", "b", "e", "q", "d", "g", "j", "p", "m", "c"}
	//sort.Sort(sort.Reverse(sort.IntSlice(intList)))
	//sort.Sort(sort.Reverse(sort.Float64Slice(floatList)))
	//sort.Sort(sort.Reverse(sort.StringSlice(stringList)))
	fmt.Println(intList)
	fmt.Println(sort.IntSlice(intList))
	fmt.Println(sort.Reverse(sort.IntSlice(intList)))
	sort.Sort(sort.Reverse(sort.IntSlice(intList)))
	fmt.Println(intList)
	//fmt.Println(floatList)
	//fmt.Println(stringList)
}
